home *** CD-ROM | disk | FTP | other *** search
/ Aminet 38 / Aminet 38 (2000)(Schatztruhe)[!][Aug 2000].iso / Aminet / util / cli / IInfo.lha / IInfo / IInfo.c next >
Encoding:
C/C++ Source or Header  |  2000-05-03  |  936 b   |  42 lines

  1. #include <proto/exec.h>
  2. #include <proto/dos.h>
  3. #include <proto/wb.h>
  4. #include <proto/intuition.h>
  5.  
  6. struct ExecBase *SysBase;
  7. struct DosLibrary *DOSBase;
  8. struct Library *WorkbenchBase;
  9. struct IntuitionBase *IntuitionBase;
  10.  
  11. main(void)
  12. {
  13. struct RDArgs *rda;
  14. struct Screen *s;
  15. BPTR l;
  16. static char *fn,*fp,t;
  17.  
  18. SysBase=*(struct ExecBase **)4L;
  19.  
  20. if(DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",0L)) {
  21.     if(WorkbenchBase=OpenLibrary("workbench.library",0L)) {
  22.         if(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0L)) {
  23.             if(rda=ReadArgs("FILENAME",(LONG *)&fn,NULL)) {
  24.                 fp=FilePart(fn);
  25.                 t=*fp; *fp='\0';
  26.                 if(l=Lock(fn,ACCESS_READ)) {
  27.                     if(s=LockPubScreen(NULL)) {
  28.                         *fp=t;
  29.                         WBInfo(l,fp,s);
  30.                         UnlockPubScreen(NULL,s);
  31.                     }
  32.                     UnLock(l);
  33.                 }
  34.             }
  35.             CloseLibrary((struct Library *)IntuitionBase);
  36.         }
  37.         CloseLibrary(WorkbenchBase);
  38.     }
  39.     CloseLibrary((struct Library *)DOSBase);
  40. }
  41. }
  42.